using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableLuxuryEquipDao:DaoBase<TableLuxuryEquip>
    {
        public override void AddPrimaryIndex(TableLuxuryEquip model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableLuxuryEquip.txt";
        }

        protected override TableLuxuryEquip ParseRowData(string[] rowData)
        {
            TableLuxuryEquip data = new TableLuxuryEquip();

            if (string.IsNullOrEmpty(rowData[0]))
            {
                data.id = 0;
            }
            else
            {
                data.id = int.Parse(rowData[0]);
            }
			data.prize = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.chapter = 0;
            }
            else
            {
                data.chapter = int.Parse(rowData[2]);
            }

            if (string.IsNullOrEmpty(rowData[3]))
            {
                data.stage = 0;
            }
            else
            {
                data.stage = int.Parse(rowData[3]);
            }

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.money = 0;
            }
            else
            {
                data.money = int.Parse(rowData[4]);
            }

            if (string.IsNullOrEmpty(rowData[5]))
            {
                data.diamond = 0;
            }
            else
            {
                data.diamond = int.Parse(rowData[5]);
            }

            if (string.IsNullOrEmpty(rowData[6]))
            {
                data.limitHours = 0;
            }
            else
            {
                data.limitHours = int.Parse(rowData[6]);
            }
			data.picture = rowData [7];

            return data;
        }



    }

}
